package com.nulgame.bukkit.plugins.listener;

import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.event.player.PlayerQuitEvent;

import com.nulgame.bukkit.plugin.AntiSpamPlugin;

public class AntiSpamListener implements Listener {
	private AntiSpamPlugin m_plugin;
	
	public AntiSpamListener(AntiSpamPlugin antiSpamPlugin){
		if(antiSpamPlugin == null){
			throw new RuntimeException("Plugin is null, we can not continue");
		}
		m_plugin =  antiSpamPlugin; 
	}
	@EventHandler
	public void onChat(AsyncPlayerChatEvent event){
		m_plugin.onChat(event);
	}
	public void OnLeave(PlayerQuitEvent event){
		m_plugin.onLeave(event.getPlayer());
	}
}
